home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16637 < prev    next >
Encoding:
Text File  |  1996-08-05  |  853 b   |  44 lines

  1. Path: mozart.wg.icl.co.uk!usenet
  2. From: Adel El-Beik <A.El-Beik@man0506.wins.icl.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: (no subject)
  5. Date: 10 Apr 1996 16:18:47 GMT
  6. Organization: ICL
  7. Distribution: world
  8. Message-ID: <4kgn17$5bb@mozart.wg.icl.co.uk>
  9. NNTP-Posting-Host: 145.227.55.172
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15. Can anyone explain why line 1 doesn't get passed MSVC++ 4.00
  16. compiler.  Whereas line 2 does. MSVC++ complains it cannot perform
  17. the conversion.
  18.  
  19.  
  20. typedef long bar[2][2];
  21. typedef const long (*const_bar)[2];
  22.  
  23.  
  24. void func( const bar param ){}
  25.  
  26.     
  27.  
  28.  
  29. void main()
  30. {
  31.     bar x;
  32.     
  33.     func( x );     //  1
  34.  
  35.     func( (const_bar)x );   // 2
  36. }
  37.  
  38.  
  39. As far as I know ( Apr 95 DWP ) an implicit conversion which adds the
  40. const should take place ???
  41.  
  42. Adel.  
  43.  
  44.